package com.yanxu;

/**
 * @author 折戟沉沙铁未销
 * @version V1.0
 * @date 2025/3/8-2025
 * @Description: 这里用一句话描述这个类的作用
 */
public class Test1 {
    public static void main(String[] args) throws InterruptedException {
        int num=1;
        doRecursion(num);
        //doOther(num);
        //System.out.println(num);
    }

    private static void doOther(int num) {
        num++;
        System.out.println("子方法 num="+num);
    }

    private static void doRecursion(Integer num) throws InterruptedException {
        try {
            while (num <= 5) {
                System.out.println("start!!!");
                Thread.sleep(1000);
                num++;
                doRecursion(num);
            }

        }finally {
            System.out.println("end!!!");
        }
    }
}